Fix SystemState_Query atomic load operating on wrong address#3302
Fix SystemState_Query atomic load operating on wrong address#3302josesimoes merged 2 commits intoadd-pico-chibiosfrom
Conversation
…of state parameter Agent-Logs-Url: https://github.com/nanoframework/nf-interpreter/sessions/0984bdaf-14ad-41c5-9f9e-2cae232dc3a8 Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughA single change to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> (cherry picked from commit 6f158c9)
SystemState_Query()on non-Cortex-M0/M0+ targets was atomically loading the localstateparameter (an enum index) instead ofSystemStates[state], effectively checking whether the state enum value itself was non-zero rather than whether the state was active. This silently broke all system state queries on M3/M4/M7 and similar cores.Change
src/HAL/nanoHAL_SystemEvents.c: Fix the__atomic_load_ntarget in the#elsebranch ofSystemState_Query():This aligns
SystemState_Query()with the atomic patterns already used inSystemState_Set()andSystemState_Clear().